Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node.cmd white space paths #51

Closed
wants to merge 4 commits into from
Closed

Fix node.cmd white space paths #51

wants to merge 4 commits into from

Conversation

equinoxel
Copy link

If node.cmd is in a path with white spaces (e.g. nyc run on windows where the user home has a space in it), the command fails with ENOENT. This should fix it.

equinoxel added 4 commits May 4, 2017 22:57
Paths with blanks for the node command are note processed correctly (see nyc)
Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind taking a look at why Windows tests are failing?

@@ -1,6 +1,6 @@
{
"name": "spawn-wrap",
"version": "1.3.4",
"version": "1.3.5-a",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to bump the version, we can do this when we release the update.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@@ -150,11 +150,15 @@ function mungeCmd (workingDir, options) {

var m = command.match(re)
var replace
var nodeCmd = workingDir + '/node.cmd'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be \\node.cmd?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily. afaik, JS on windows can parse "/" paths properly. One can use e.g. the "path" package:

var path = require("path");
var absolutePath = path.resolve("Relative file path");

@@ -150,11 +150,15 @@ function mungeCmd (workingDir, options) {

var m = command.match(re)
var replace
var nodeCmd = workingDir + '/node.cmd'
if(workingDir.indexOf(' ') !== -1) {
nodeCmd = ' "' + nodeCmd + '"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to not just always wrap the nodeCmd in quotes for Windows?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I don't think there are side-effects.

@felixfbecker
Copy link

What's the status of this? Seems like this should fix #69, which currently prevents me from getting coverage with nyc in AppVeyor :(

@coreyfarrell
Copy link
Member

I believe this issue has been addressed by other PR's for the 2.x release line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants